package com.example.javacrawl.worker;


import com.example.javacrawl.service.LeftGraphDataService;
import com.example.javacrawl.service.RightGraphDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

@Service
public class DynamicGetDataWorker{

    @Autowired
    private LeftGraphDataService leftGraphDataService;

    @Autowired
    private RightGraphDataService rightGraphDataService;

    @Async
    @Scheduled(fixedDelay = 15000)
    public void work(){
            leftGraphDataService.handleData();
            rightGraphDataService.handleData();

    }

}
